﻿using System;
using System.Collections.Generic;

#if WINDOWS_PHONE
namespace Fibre.WP7.Threading
#else
#if SILVERLIGHT
namespace Fibre.Silverlight.Threading
#else
namespace Fibre.Threading
#endif
#endif
{
    /// <summary>
    /// Represents a item work work.
    /// </summary>
    public class WorkItem
    {
        private readonly List<Action<IAsyncResult>> _completedEvents = new List<Action<IAsyncResult>>();

        /// <summary>
        /// Gets or sets the work to be performed
        /// </summary>
        /// <value>The work.</value>
        public Func<AsyncCallback, IAsyncResult> Work { get; set; }
        /// <summary>
        /// Gets the the of WorkComplete callbacks
        /// </summary>
        /// <value>The completed callbacks.</value>
        public List<Action<IAsyncResult>> CompletedEvents { get { return _completedEvents;  } }
    }
}